//  web.js
//  引入http模块
var http = require("http");
var fs = require("fs");

var requestHandler = function(req, res) {
  fs.readFile("./dist/index.html", "utf-8", function(err, data) {
    //读取内容
    res.writeHead(200, {
      "Content-Type": "text/html"
    });
    res.write(data);
  });
};
//创建服务器
var web = http.createServer(requestHandler);

//设置监听端口号
web.listen(7878);
console.log(787878);
